package com.example.dllo.my36kr.ui.activity.sonactivity;

import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;

import com.example.dllo.my36kr.R;
import com.example.dllo.my36kr.db.DBTool;
import com.example.dllo.my36kr.model.CollectBean;
import com.example.dllo.my36kr.model.CollectListBean;
import com.example.dllo.my36kr.ui.activity.AbsBaseActivity;
import com.example.dllo.my36kr.ui.adapter.CollectAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by CPC_272 on 16/8/30.
 */
public class CollectActcvity extends AbsBaseActivity implements View.OnClickListener {
    private ListView listViewOfCollect;
    private ImageView back_image;
    private CollectAdapter collectAdapter;
    @Override
    protected int setLayout() {
        return R.layout.activity_collect;
    }
    @Override
    protected void initView() {
        listViewOfCollect = byView(R.id.ls_collect);
        back_image = byView(R.id.back_coellect);
    }
    @Override
    protected void initData() {
        collectAdapter = new CollectAdapter(this);
        back_image.setOnClickListener(this);

        DBTool dbTool = DBTool.getInstance();
        dbTool.queryUesr(new DBTool.QueryListener() {
            @Override
            public void onQueryComplete(ArrayList<CollectBean> nativeBeen) {
                collectAdapter.setCollectBeen(nativeBeen);
                listViewOfCollect.setAdapter(collectAdapter);
            }
        });
    }
    @Override
    public void onClick(View v) {
        finish();
    }


}
